package com.heima.search;
import java.util.Date;

import com.heima.model.search.pojos.ApAssociateWords;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.mongodb.core.MongoTemplate;

@SpringBootTest
public class AddWordsToMogo {
    @Autowired
    private MongoTemplate mongoTemplate;
   @Test
    public void insert(){
       for (int i = 0; i < 10; i++) {
           ApAssociateWords apAssociateWords = new ApAssociateWords();
           apAssociateWords.setAssociateWords("江疏影" + i);
           apAssociateWords.setCreatedTime(new Date());
           mongoTemplate.insert(apAssociateWords);
       }
       System.out.println("添加结束");


   }
}
